From: Daniel Nylander Date: Fri, 11 Sep 2026 17:52:52 +0000 (+0200) Subject: screenshot: Handle a missing recent-files history X-Git-Tag: archive/raspbian/50.5-1+rpi1^2~6^2^2~10 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e08280a57d8f242ddd7d6458b21c9ccf2eed797e;p=gnome-shell.git screenshot: Handle a missing recent-files history On a profile without recently-used.xbel, taking a screenshot saves the PNG but does not add it to recent files. GLib.BookmarkFile.load_from_file() reports a missing file as GLib.FileError.NOENT, while the handler checked GLib.BookmarkFileError.FILE_NOT_FOUND and returned. Fixes: b89d90eb80 ("screenshot: Use GLib.BookmarkFile to save recent screenshots") Part-of: (cherry picked from commit fa82d28c3b0dcfd27e49bac291b37b5ca9237dc7) --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 499baa8f4..f4353845a 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -2308,7 +2308,7 @@ function _storeScreenshot(bytes, pixbuf) { try { bookmarks.load_from_file(recentFile); } catch (e) { - if (!e.matches(GLib.BookmarkFileError, GLib.BookmarkFileError.FILE_NOT_FOUND)) { + if (!e.matches(GLib.FileError, GLib.FileError.NOENT)) { log(`Could not open recent file ${uri}: ${e.message}`); return; }